package cn.rjzjh.tapestry.busi.model;

// Generated 2014-9-6 10:25:55 by Hibernate Tools 4.0.0

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import cn.rjzjh.tapestry.busi.SpringInit;
import cn.rjzjh.tapestry.busi.tools.BusiAssit;
import cn.rjzjh.tapestry.component.constant.list.OptionGroup;
import cn.rjzjh.tapestry.component.constant.list.YesOrNo;

/**
 * OptionItem generated by hbm2java
 */
@Entity
@Table(name = "OptionItem")
public class OptionItem implements java.io.Serializable {

	private String id;
	private OptionGroup group;
	private String parentId;
	private String itemCode;
	private String itemNameZh;
	private String itemNameEn;
	private Integer orderNo;
	private String field1;
	private String field2;
	private String field3;
	private String field4;
	private String remark;
	private YesOrNo isValid;
	private Date createTime;

	public OptionItem() {
	}

	/****
	 * 由插件加入缓存代码
	 *
	 * @param id
	 * @return
	 */
	public static final OptionItem get(String id) {
		OptionItem item = BusiAssit.findById(OptionItem.class, id);
		return item;
	}

	public OptionItem(String id) {
		this.id = id;
	}

	public OptionItem(String id, OptionGroup group, String parentId,
			String itemCode, String itemNameZh, String itemNameEn,
			Integer orderNo, String field1, String field2, String field3,
			String field4, String remark, YesOrNo isValid, Date createTime) {
		this.id = id;
		this.group = group;
		this.parentId = parentId;
		this.itemCode = itemCode;
		this.itemNameZh = itemNameZh;
		this.itemNameEn = itemNameEn;
		this.orderNo = orderNo;
		this.field1 = field1;
		this.field2 = field2;
		this.field3 = field3;
		this.field4 = field4;
		this.remark = remark;
		this.isValid = isValid;
		this.createTime = createTime;
	}

	@Id
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "groupCode", length = 32)
	@Enumerated(EnumType.STRING)
	public OptionGroup getGroup() {
		return group;
	}

	public void setGroup(OptionGroup group) {
		this.group = group;
	}

	@Column(name = "itemCode", length = 30)
	public String getItemCode() {
		return this.itemCode;
	}

	public void setItemCode(String itemCode) {
		this.itemCode = itemCode;
	}

	@Column(name = "itemName_zh", length = 100)
	public String getItemNameZh() {
		return this.itemNameZh;
	}

	public void setItemNameZh(String itemNameZh) {
		this.itemNameZh = itemNameZh;
	}

	@Column(name = "itemName_en", length = 100)
	public String getItemNameEn() {
		return this.itemNameEn;
	}

	public void setItemNameEn(String itemNameEn) {
		this.itemNameEn = itemNameEn;
	}

	@Column(name = "orderNo")
	public Integer getOrderNo() {
		return this.orderNo;
	}

	public void setOrderNo(Integer orderNo) {
		this.orderNo = orderNo;
	}

	@Column(name = "field1", length = 200)
	public String getField1() {
		return this.field1;
	}

	public void setField1(String field1) {
		this.field1 = field1;
	}

	@Column(name = "field2", length = 200)
	public String getField2() {
		return this.field2;
	}

	public void setField2(String field2) {
		this.field2 = field2;
	}

	@Column(name = "field3", length = 200)
	public String getField3() {
		return this.field3;
	}

	public void setField3(String field3) {
		this.field3 = field3;
	}

	@Column(name = "field4", length = 200)
	public String getField4() {
		return this.field4;
	}

	public void setField4(String field4) {
		this.field4 = field4;
	}

	@Column(name = "remark", length = 2000)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "isValid")
	@Enumerated(EnumType.STRING)
	public YesOrNo getIsValid() {
		return this.isValid;
	}

	public void setIsValid(YesOrNo isValid) {
		this.isValid = isValid;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "createTime", length = 23)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "parentId", length = 32)
	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

}
